<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>

	</head>
	<body>
		<button>this</button>
		<script type="text/javascript">
			// window.alert("window对象");
			// window.prompt("请输入姓名", "张三");
			var name = "张三";

			//当前对象
			function fn() {
				console.log(this);//window
			}

			// console.log(window.name);
			// window.fn();

			//构造函数
			function Student(name, age) {
				this.name = name;
				this.age = age;
			}

			// console.dir(window);
			var s1 = new Student("李四", 20);//
			var s2 = new Student("王五", 30);

			var btn = document.querySelector("button");
			btn.addEventListener("click", function() {
				// btn
				console.log(this);
			})
		</script>
	
	</body>
</html>
